package com.starbugs.wehcat.jdbc;

import java.util.List;

/**
 * @author ASUS
 */
public interface UserRepository {
  /**
   * 创建表
   * @param tableName tableName
   */
  public void createTable(String tableName);

  /**
   * 添加用户
   * @param user user
   * @return int id
   */
  public int addUser(User user);

  /**
   * update用户
   * @param user user
   * @return int id
   */
  public int updateUser(User user);

  /**
   * delete用户
   * @param id id
   * @return int id
   */
  public int deleteUser(int id);

  /**
   * find用户
   * @param id id
   * @return User User
   */
  public User findUserById(int id);

  /**
   * find所有用户
   * @return User User
   */
  public List<User> findAll();

  /**
   * 赠送积分
   * @param outUser outUser
   * @param inUser inUser
   * @param points points
   */
  public void transfer(String outUser, String inUser, int points);
}
